]> dgit.raspbian.org Git - gnome-shell.git/commit
extensionBase: Add static lookupByURL() method
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 10 Jul 2023 04:19:53 +0000 (06:19 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 30 Jul 2023 07:29:44 +0000 (10:29 +0300)
commitcd99fbae50b7d08a1ce93440d7a93f57cb098155
treebebb8750a0c15c5af2ffb544e75808d04fd127c7
parent348a8e49fe42b24c28145cf039fb00ef6cd25153
extensionBase: Add static lookupByURL() method

With convenience API like getSettings() now being provided by
the ExtensionObject subclass, extensions will need to access
their entry point more often.

Having to pass a pointer through the hierarchy can be annoying,
so add a static method that allows them to look it up:

```js
    const ext = Extension.lookupByURL(import.meta.url);
    this._settings = ext.getSettings();
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>
js/extensions/sharedInternals.js